home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9245 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: news.gate.net!!bcfreenet!z007400b
  2. From: z007400b@bcfreenet.seflin.lib.fl.us (Ralph Silverman)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Looking for a clear screen function
  5. Date: 7 Mar 1996 21:03:29 GMT
  6. Organization: SEFLIN Free-Net - Broward
  7. Message-ID: <4hniv1$8h6@news.seflin.lib.fl.us>
  8. References: <4gaeba$d9h@nkosi.well.com> <3129AC77.5F25@fokus.gmd.de> <TANMOY.96Feb20084655@qcd.lanl.gov> <mhoward-2102960702470001@port2.sniff.smallmedia.com> <312BE000.1401@post.drexel.edu>
  9. NNTP-Posting-Host: ns2.seflin.lib.fl.us
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Sean P Kelly (st94e485@post.drexel.edu) wrote:
  13. : > > In article <3129AC77.5F25@fokus.gmd.de> Watson <sayegh@fokus.gmd.de>
  14. : > > writes:
  15. : > >    > Does anyone know of a clear screen function to use both in turboC++ on
  16. : > >    > a PC and one to use in standard C for Unix machines
  17. : > >
  18. : > >    #include<stdio.h>
  19. : > >    for (int i=0;i<25;i++)
  20. : > >            printf("\n");
  21. : > >
  22. : I'm not familiar with Turbo C++ for PC's, but for UNIX the simplest method is to 
  23. : execute a shell command:
  24.  
  25. : if (fork() == 0)  {
  26. :   execlp ("clear", "clear");
  27. :   printf ("System error: execlp\n");
  28. : }
  29. :   else wait (NULL);
  30.  
  31. : If that doesn't work, try:  execl ("path-to-clear", "clear");
  32.  
  33. : Of course, for more elaborate screen manipulation, you can always use the curses 
  34. : library.
  35.  
  36. : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  37. :  Sean P Kelly                                           Drexel University
  38. :  st94e485@post.drexel.edu                   Electrical Engineering
  39. :  skipper@cyberspace.com
  40. :                                                                 
  41. :              "It's a rough old life, up here on the wagon"           
  42. :  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  43.  
  44. --
  45. ***********begin r.s. response*************
  46.  
  47.     in (pc ms dr)dos...
  48.     how about...
  49.         system("@echo off");
  50.         system("cls");
  51.     ...
  52.  
  53. ***********end r.s. response***************
  54. Ralph Silverman
  55. z007400b@bcfreenet.seflin.lib.fl.us
  56.  
  57.